package com.walker.controller.catalogue;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.walker.anno.ResponseResult;
import com.walker.service.catalogue.CatalogueServicesService;

import net.sf.json.JSONObject;

/**
 * 资产-目录-服务
 */
@RestController
@RequestMapping(value = "/catalogueServices")
@ResponseResult
public class CatalogueServicesController {

	@Resource
	private CatalogueServicesService service;
	
	/**
	 * 服务列表
	 * @param request
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@PostMapping("queryServieList")
	public Map<String, Object> queryServieList(@RequestBody String request) {
		Map<String, Object> params = JSONObject.fromObject(request);
		return service.queryServieList(params);
	}
	
	/**
	 * 分组信息
	 * @return
	 */
	@PostMapping("queryGroupInfo")
	public List<Map<String, Object>> queryGroupInfo() {
		return service.queryGroupInfo();
	}
	
	/**
	 * 服务明细
	 * @return
	 */
	@PostMapping("queryServieDetail")
	public Map<String, Object> queryServieDetail(@RequestBody String api_id) {
		return service.queryServieDetail(api_id);
	}
}